Select a project or folder (or any combination of projects and folders) in the sidebar.
Click the Focus toolbar button, or choose Focus on — from the View menu. Everything outside your selection disappears from the sidebar, and the title at the top of the window changes to Focusing on —.
As you work in planning mode, or switch to context mode, OmniFocus ignores everything outside of your focus, as if the items you're focusing on are the only items in your library.
When you're done focusing, choose Show All Projects from the View menu, or click the Show All toolbar button. Your library comes back as if nothing ever happened!